<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>
<html>
<head>
    <title>员工</title>
</head>
<body>
<div class="pageheader">
    <h2>添加员工</h2>
</div>
<div class="contentpanel">
    <div class="panel panel-default">
        <form:form commandName="formDto" cssClass="form-horizontal form-bordered">
            <input type="hidden" name="continuation" id="continuation" value="false"/>

            <div class="form-group">
                <label class="col-sm-3 control-label">姓名</label>

                <div class="col-sm-6">
                    <form:input path="name" cssClass="form-control" placeholder="员工姓名"/>
                    <form:errors path="name" cssClass="error text-danger"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">性别</label>

                <div class="col-sm-6 ">
                    <div class="radio">
                        <label><form:radiobutton path="gender" value="1"/>
                            男
                        </label>
                        <label><form:radiobutton path="gender" value="2"/>
                            女
                        </label>
                    </div>
                    <form:errors path="gender" cssClass="error text-danger"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">年龄</label>

                <div class="col-sm-6">
                    <form:input path="age" cssClass="form-control" placeholder="员工年龄"/>
                    <form:errors path="age" cssClass="error text-danger"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">电话</label>

                <div class="col-sm-6">
                    <form:input path="phone" cssClass="form-control" placeholder="电话号码"/>
                    <form:errors path="phone" cssClass="error text-danger"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">分派人员
                <span class="fa fa-info-circle" data-container="body" data-toggle="popover"
                      data-placement="right" data-content="分派人员有分派案件的权利" data-original-title=""
                      title=""></span>
                </label>

                <div class="col-sm-9">
                    <div class="checkbox block">
                        <label><form:checkbox path="leader"/></label>
                    </div>
                </div>
            </div>
            <div class="form-group">

                <label class="col-sm-3 control-label">社区监督人员
                    <span class="fa fa-info-circle" data-container="body" data-toggle="popover"
                          data-placement="right" data-content="社区监督人员上报案件时,优先上报到本社区进行处置." data-original-title=""
                          title=""></span>
                </label>

                <div class="col-sm-9">
                    <div class="checkbox block">
                        <label><form:checkbox path="inspector"/></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">部门</label>

                <div class="col-sm-6">
                    <custom:dept_tree_list list="${formDto.childDept}" index="0" name="deptUuid"/>
                    <custom:dept_tree_input_list list="${formDto.childDept}" index="0" name=""/>
                    <form:errors path="deptUuid" cssClass="error text-danger"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>

                <div class="col-sm-8">
                    <button type="submit" class="btn btn-primary">提交</button>
                    <button type="submit" class="btn btn-success continue">提交并继续添加</button>
                    <a href="javascript:window.history.go(-1);" class="btn btn-default">取消</a>
                </div>
            </div>
        </form:form>
    </div>
</div>
<script type="text/javascript">
    $('[data-toggle="popover"]').popover({html: true});
    $(".continue").click(function () {
        $("#continuation").val(true);
    });
    <c:if test="${not empty param.edit}">
    jQuery.gritter.add({
        title: '新增/编辑 成功!',
        class_name: "growl-success",
        sticky: false
    });
    </c:if>
</script>
</body>
</html>